package com.squirrel;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author wangyan
 */
@Component
public class DataBeanConfig {

    @Autowired
    private DruidDataSourceAutoConfigure druidDataSourceAutoConfigure;

    public String getDriverClassName() {
        DruidDataSource dataSource = (DruidDataSource) druidDataSourceAutoConfigure.dataSource();
        String driverClassName = dataSource.getDriverClassName();
        return driverClassName;
    }
}

